import { moduleList, saveModule, getModuleById, enabledControl } from '@/services/settings/menu/menuButtonsService';

export default {
  namespace: 'menuButtonsModel',

  state: {},

  effects: {
    *moduleList({ payload, callback }, { call, put }) {
      const response = yield call(moduleList, payload);
      if(callback) callback(response);
    },
    *saveModule({ payload, callback }, { call, put }) {
      const response = yield call(saveModule, payload);
      if(callback) callback(response);
    },
    *getModuleById({ payload, callback }, { call, put }) {
      const response = yield call(getModuleById, payload);
      if(callback) callback(response);
    },
    *enabledControl({ payload, callback }, { call, put }) {
      const response = yield call(enabledControl, payload);
      if(callback) callback(response);
    },
  },

  reducers: {
  },
};
